/* USER CODE BEGIN Header */
/**
  ******************************************************************************
  * @file           : 
  * @brief          : 
  ******************************************************************************
  * @attention
  *
  ******************************************************************************
  */
/* USER CODE END Header */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __DRIVERPARA_H
#define __DRIVERPARA_H

#ifdef __cplusplus
extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "structs.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */

/* USER CODE END Includes */

/* Exported types ------------------------------------------------------------*/
/* USER CODE BEGIN ET */

/* USER CODE END ET */

/* Exported constants --------------------------------------------------------*/
/* USER CODE BEGIN EC */

/* USER CODE END EC */

/* Exported macro ------------------------------------------------------------*/
/* USER CODE BEGIN EM */

/* USER CODE END EM */

/* Private defines -----------------------------------------------------------*/
/* USER CODE BEGIN Private defines */
#define 	R_SHUNT 									0.010f  // 10mR
#define 	AMPLIFICATION							7.33f	 //
#define 	PHASE_I_MAXIMUM						22.5f  //22.5 Ampre
#define   Amp_Num_SCALE							(32768.0f/PHASE_I_MAXIMUM)
//#define 	PHASE_I_SCALE							PHASE_I_MAXIMUM/32768.0f
#define 	ENCODER_RANGE							65536.0f	 //
#define 	DT								 				0.00005f //pwm period 50us
#define 	MOTOR_PWM_PERIOD   				20000 //20K 
#define 	PWM_ARR										(170000000/2/MOTOR_PWM_PERIOD)
#define   MOTOR_SPEED_MAXIMUN       6000.0f
//special parameters
#define   SPEED_CLOSE_PERIOD				10000	//10K
#define 	SPEED_CLPSE_COUNT					(MOTOR_PWM_PERIOD / SPEED_CLOSE_PERIOD)
#define   SPEED_PID_GAIN 						1000.0f

/* USER CODE END Private defines */


/* Exported functions prototypes ---------------------------------------------*/
void Default_UserParameter(UserParaUnion * Parameters);

/* USER CODE BEGIN EFP */

/* USER CODE END EFP */
#ifdef __cplusplus
}
#endif

#endif 
